package com.bella.springcloud.config;/**
 * @program: cloud2022
 * @description:
 * @packagename: com.bella.springcloud.config
 * @author: Bella白
 * @date: 2022-09-03 17:02
 **/

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: bella白
 * @Title: GateWayConfig
 * @ProjectName: cloud2022
 * @Description:
 * @date: 2022/9/3 17:02
 */

@Configuration
public class GateWayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder) {
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        routes.route("path_route_bella", r -> r.path("/guoji").uri("http://news.baidu.com/guonei"))
                .build();
        return routes.build();
    }
}
